<?php
/**
 * Dependency abstract aggregator
 *
 * PHP version 5
 *
 * @category  W
 * @package   Services
 * @author    Olivier Hoareau <olivier@phppro.fr>
 * @copyright 2009 PHPPRO http://www.phppro.fr
 * @license   http://dev.phppro.fr/license PHPPRO
 * @version   SVN: $Id:$
 * @link      http://dev.phppro.fr/projects/wdependency
 */
require_once 'W/W.php';
require_once 'W/Dependency/Aggregator/Interface.php';
require_once 'W/Dependency/Operator/Abstract.php';
/**
 * Dependency abstract aggregator
 *
 * @category  W
 * @package   Services
 * @author    Olivier Hoareau <olivier@phppro.fr>
 * @copyright 2009 PHPPRO http://www.phppro.fr
 * @license   http://dev.phppro.fr/license PHPPRO
 * @version   SVN: $Id$
 * @link      http://dev.phppro.fr/projects/wdependency
 */
abstract class W_Dependency_Aggregator_Abstract extends W_Dependency_Operator_Abstract implements W_Dependency_Aggregator_Interface
{
    public function process($data=null)
    {
        return $this->aggregate($data);
    }
    public function aggregate($data)
    {
        $data = $data['data'];
        $data = $this->reduce($data);
        return $data;
    }
    public abstract function reduce($data);
}